﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ACP.DTO;

namespace ACP.Data
{
    public class SupportRepository 
    {
        public static List<SupportType> getSupporTypes()
        {
            Repository<SupportType> supportTypeRepository = new Repository<SupportType>();
            List<SupportType> lstSupporTypes;
            try
            {
                lstSupporTypes = supportTypeRepository.AsQueryable().OrderBy(s=>s.Rank).ToList();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                supportTypeRepository.Dispose();
            }
            return lstSupporTypes;
        }


        public static void InsertSupportInformation(EnquiryInfo enquiryInfo)
        {
            Repository<EnquiryInfo> enquiryInfoRepository = new Repository<EnquiryInfo>();
            try
            {
                enquiryInfoRepository.Add(enquiryInfo);
                enquiryInfoRepository.UnitOfWork.Commit();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                enquiryInfoRepository.Dispose();
            }
        }

    }
}
